package jzOffer;

/**
 * @author 郝文雪
 * @date 2022/8/2 20:29
 * @Description Test
 */
public class JZ15 {
    public int NumberOf1(int n) {
        int count=0;
        while(n!=0){
            n=(n-1)&n;
            count++;
        }
        return count;
    }
}
